home *** CD-ROM | disk | FTP | other *** search
- {[j=20-/40/80!,o=95,a-]} { PasMat formatting options }
-
- {Cameron Birse, Macintosh Technical Support}
-
- PROGRAM ShowMonitors;
-
- {$U-}
-
- USES
- Memtypes,QuickDraw,OSIntf,ToolIntf,PackIntf,MacPrint,Script;
-
-
- TYPE
- SysEnvRec = RECORD
- environsVersion: INTEGER;
- machineType: INTEGER;
- systemVersion: INTEGER;
- processor: INTEGER;
- hasFPU: BOOLEAN;
- hasColorQD: BOOLEAN;
- keyBoardType: INTEGER;
- atDrvrVersNum: INTEGER;
- sysVRefNum: INTEGER;
- END;
-
- SysEnvRecPtr = ^SysEnvRec;
- RectArray = array [1..6] of rect;
-
- VAR
- myStr : Str255;
- err : Integer;
- HPB : HParamBlockRec; {Just use one parameter block for everything}
- HPBPtr : HParmBlkPtr; {Here's the pointer to it}
- GDHdl : GDHandle;
- getOut,doneflag : boolean;
- MrIndex, HowMany, wRef : integer;
- PackORects : RectArray;
- wRecord : WindowRecord;
- MyWindow : WindowPtr;
- WRect,aRect : rect;
- TheWorld : SysEnvRec;
- EnvPtr : SysEnvRecPtr;
-
- {------------------------------------------------------------------------------------}
-
- PROCEDURE Debugger; INLINE $A9FF;
-
- {--------------------------------------------------------------------------------------------}
-
- FUNCTION SysEnvirons(versionRequested: INTEGER; VAR theWorld: SysEnvRec): OSErr;
-
- INLINE $205f,$301f, $A090, $3e80;
-
- {------------------------------------------------------------------------------------}
- Procedure DoInit;
- { Do all toolbox and global variable initialization neccessary }
- begin
- initgraf(@thePort);
- initFonts;
- initWindows;
- initMenus;
- TEInit;
- initDialogs(nil);
- initcursor;
- doneflag := false;
- GetDateTime(RandSeed);
- end; { procedure DoInit }
-
- {------------------------------------------------------------------------------------}
-
- BEGIN {main PROGRAM}
-
- DoInit; {Init them Mgrs.}
-
- getOut := false;
-
- wRef := 1;
- SetRect(WRect,40,40,450,300);
- MyWindow := NewWindow (@wRecord, WRect, 'Hey Now!', true, documentProc, WindowPtr(-1), true, wRef);
- SetPort (MyWindow);
- err:= SysEnvirons (1,TheWorld);
- if err = noerr then
- begin
- if theWorld.HasColorQD then
- begin
-
- GDHdl := GetDeviceList;
- PackORects[1] := GDHdl^^.gdRect;
-
- MrIndex := 2;
- repeat
- begin
- GDHdl := GetNextDevice (GDHdl);
- if GDHdl <> nil then
- begin
- PackORects[MrIndex] := GDHdl^^.gdRect;
- MrIndex := MrIndex + 1;
- end
- else getout := true
- end;
- until getout;
-
- HowMany := MrIndex - 1;
-
- For MrIndex := 1 to HowMany do
- begin
- aRect.top := (160+PackORects[MrIndex].top div 10);
- aRect.left := (205+PackORects[MrIndex].left div 10);
- aRect.bottom := (160+PackORects[MrIndex].bottom div 10);
- aRect.right := (205+PackORects[MrIndex].right div 10);
- FrameRect (aRect);
- end;
-
- repeat until button;
-
- end else begin
- MoveTo (20,20);
- DrawString ('This program only works on machines');
- MoveTo (20,40);
- DrawString ('equipped with color QuickDraw');
- repeat until button;
- end;
- end;
- CloseWindow (MyWindow);
- End.